from odoo import fields, models, api


class Goods(models.Model):
    _name = 'dragon.goods'
    _description = '三龙百货商品'
    _rec_name = 'name'

    sequence = fields.Integer(
        string='Sequence'
    )
    # 勿删，拖动排序需要

    # sale_id = fields.Many2one(
    #     'dragon.sale'
    # )

    barcode = fields.Char(
        '商品条码'
    )

    good_number = fields.Char(
        '商品编号'
    )

    name = fields.Char(
        '商品全名',
    )

    package_type = fields.Char(
        '包装规格'
    )

    unit = fields.Char(
        '单位'
    )

    price = fields.Float(
        '价格'
    )

    # sum_money = fields.Float(
    #     '金额',
    #     readonly=True
    # )

    remark = fields.Char(
        '备注'
    )

    # @api.depends('amount', 'price')
    # def _compute_amount_total(self):
    #     for line in self:
    #         line.sum_money = line.amount * line.price
